package com.itheima.practice;
//使用缓冲流+字节数组拷贝文件
import java.io.*;

public class Test02 {
    public static void main(String[] args) throws IOException {
        //1.使用缓冲流对象
        BufferedInputStream bis = new BufferedInputStream(new FileInputStream("C:\\Users\\峰大帝\\Desktop\\a.txt"));
        BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("C:\\Users\\峰大帝\\Desktop\\a2.txt"));
        //2.拷贝
        int len;
        byte[] data = new byte[1024];
        while ((len = bis.read(data)) != -1){
            bos.write(data,0,len);
        }
        //3.释放资源
        bis.close();
        bos.close();
    }
}
